#include <bits/stdc++.h>
using namespace std;

int n,a[200005],send[200005];

int main()
{
	freopen("fruit.in","r",stdin);
	freopen("fruit.out","w",stdout);
	scanf("%d",&n);
	for(int i = 1; i <= n; i++)
	{
		scanf("%d",&a[i]);
		send[i] = a[i];
	}
	bool empt = false;
	while(empt == false)
	{
		for(int i = 1; i <= n; i++)
		{
			if(a[i] < 2 && a[i] != a[i-1])
			{
				printf("%d ",i);
				send[i] = 2;
			}
		}
		printf("\n");
		for(int i = 1; i <= n; i++)
		{
			a[i] = send[i];
		}
		bool allempty = true;
		for(int i = 1; i <= n; i++)
		{
			if(a[i] < 2) allempty = false;
		}
		if(allempty == true)empt = true;
	}
}
//12 1 1 0 0 1 1 1 0 1 1 0 0

